/*
 * This file is part of b.AMP.
 *
 * b.AMP is free software: you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * b.AMP is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with b.AMP.  If not, see <http://www.gnu.org/licenses/>.
 */

#include "service/process_test.hpp"

#include <bamp/exception.hpp>

#include <boost/test/unit_test.hpp>
#include <boost/test/unit_test_monitor.hpp>

#include <iostream>

using namespace boost::unit_test;

void print_bamp_exception(const bamp::Exception& e)
{
    std::cerr << "b.AMP exception: " << e.what() << "." << std::endl;
    throw e;
}


test_suite* init_unit_test_suite(int argc, char* argv[] ) {
    test_suite* test = BOOST_TEST_SUITE("bamp_test");

    // When a bamp::Exception is thrown during a test, the exception
    // translator function will print its value.
    unit_test_monitor.register_exception_translator<bamp::Exception>
        ( &print_bamp_exception );

    return test;
}
